package com.lebang.medicalInquiry.mapper;

import com.lebang.medicalInquiry.model.po.ConsultationSheet;
import org.apache.ibatis.annotations.Mapper;
import com.lebang.medicalInquiry.model.vo.ConsultationSheetVo;
import com.lebang.medicalInquiry.model.vo.ConsultationSheetStatisticsVo;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.MapKey;
import com.lebang.medicalInquiry.model.po.ConsultationSheetSchedule;
import com.lebang.medicalInquiry.model.vo.ConsultationSheetInfoVo;

@Mapper
public interface ConsultationSheetMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(ConsultationSheet record);

    int insertSelective(ConsultationSheet record);

    ConsultationSheet selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(ConsultationSheet record);

    int updateByPrimaryKey(ConsultationSheet record);

    // 根据问诊单查询对应的问诊进度
    List<ConsultationSheetSchedule> getConsultationScheduleList(@Param("sheetId") Integer sheetId);

    Integer countUnfinish(@Param("userPatientId") Integer userPatientId, @Param("operatorUuid") String organizationOperationUuid);

    // 查询未结束的问诊单列表 ， 根据状态距离结束 来进行排序
    List<ConsultationSheetInfoVo> getConsultationSheetList(@Param("uuid") String uuid, @Param("operationUuid") String operationUuid, @Param("status") String status, @Param("page") Integer page, @Param("limit") Integer limit);

    // 查询机构负责的问诊单状态和对应的数量
    List<ConsultationSheetStatisticsVo> countByOperatorUuidAndStatus(@Param("operatorUuid") String operatorUuid, @Param("statusList") List<String> status);

    ConsultationSheetInfoVo getInfoById(Integer consultationSheetId);

    List<ConsultationSheetStatisticsVo> countByType(@Param("operatorUuid") String operatorUuid);
}